1. Field of the Invention
The present invention relates to a method and apparatus for rendering three dimensional (3D) graphics data, and more particularly, to a method and apparatus for rendering 3D graphics data by using a video frame image generated from a video stream.
2. Description of the Related Art
Along with the appearance of Portable Multimedia Players (PMPs), support of mobile viewing, and cellular phones supporting Digital Multimedia Broadcasting (DMB) and Digital Video Broadcasting-Handheld (DVB-H), hardware processing three dimensional (3D) graphics data and a video decoder have been being developed as a single System On Chip (SOC). As a result, the need to effectively use a video stream as a texture source of 3D graphics data is increasing. Texture means an image pattern of colors to be applied to the surface of a 3D object.
There is a method of using a mipmap in order to generate textures to be used on 3D graphics data. Mipmap is a set of textures, each texture having a gradually lower resolution for the same image. If height and width of each texture is expressed by a mipmap level, an image of a certain mipmap level is less, by a power of 2 in terms of height and width, than an image of a previous mipmap level. For example, if it is assumed that the size of a mipmap level 0 is 1, the size of a mipmap level 1 is a ¼ of the size of the mipmap level 0, and the size of a mipmap level 2 is a ¼ of the size of the mipmap level 1. In this manner, a mipmap is produced by continuously decreasing each size by a ½. Mipmapping is performed in order to pre-generate mipmap level images having various sizes and perform texture mapping using an image of a mipmap level having the closest size to 3D graphics data.
A mipmap is most frequently used among anti-aliasing schemes for textures. Since all pictures are composed of pixels in output devices of a raster method, each boundary of slant lines or pictures is not shown smoothly due to “jaggies” or aliasing, and if resolution of output devices is low, the “jaggies” or aliasing is clearer. A scheme of smoothly showing these lines and/or boundaries is called anti-aliasing. By using a mipmap, a series of textures smaller than an original texture prior to rendering is generated. Smaller textures are ¼ the size of a previous texture and are repeatedly generated until the size of a texture becomes 1. A mipmap corresponding to the size of a texture is needed for rendering. Thus, in order to generate a texture to be used for 3D graphics data, a mipmap is generated from a texture immediately before rendering, or textures of all mipmap levels must be previously generated when the texture is generated. An example of the latter is a Direct Draw Surface (DDS) file format.
Two cases where a video stream is used as a texture source for 3D graphics data may exist. The first one is a case where it can be known before the video stream is used as a texture. In this case, a method of using the video stream as a texture is as follows. A video decoder generates a video frame image by decoding the video stream, generates a mipmap of the generated video frame image, and stores the generated mipmap in memory. A 3D pipeline converting 3D graphics data to a 2D raster image calculates a mipmap level of a 3D graphics primitive which is a basic constituent unit of objects indicated by 3D graphics data, selects a mipmap closest to the calculated mipmap level from among mipmaps stored in the memory, and performs texture filtering using the selected mipmap.
The texture filtering is a method of determining color information of each of pixels of 3D graphics data from texels. However, the 3D graphics data rendering method described above has a problem in that video frame images corresponding to all mipmap levels are previously generated and used with finally using only a video frame image corresponding to a single mipmap level when a 3D object is rendered. There is another problem in that when mipmap data corresponding to all video frame images of a video stream is previously generated and used as textures, much storage space is needed to store the mipmap data.
The second case where a video stream is used as a texture source for 3D graphics data is a case where it cannot be known before the video stream is used as a texture. An example is a case where a bitstream is transmitted in real-time, as in Moving Picture Experts Group (MPEG) or DMB. In this case, since a video stream is transmitted in real-time, there is not sufficient time to generate mipmap data before a video frame image generated from the video stream is used as a texture and to use one of the generated mipmap data as a texture.